<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use dosamigos\ckeditor\CKEditor;

/* @var $this yii\web\View */
/* @var $model backend\models\ArchiveItem */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="create-form archive-item-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'id_section')->dropDownList(
            ArrayHelper::map($sections,
                'id',
                function($model) {
                    return $model['number'] . ' - ' . $model['name'];
                }
            ),
            [
                'prompt' => 'Выбор раздела',
            ]
        )->label('Раздел') 
    ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'm_number')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'is_Digitized')->radioList([
            '0'=>'Нет',
            '1'=>'Да',
        ]); 
    ?>

    <?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'register')->widget(CKEditor::className(), [
            'options' => ['rows' => 6],
            'preset' => 'custom',
            'clientOptions' =>  [
                'toolbarGroups' => [
                    ['name' => 'clipboard', 'groups' => ['mode', 'undo', 'doctools']],
                    ['name' => 'editing', 'groups' => ['tools']],
                    ['name' => 'paragraph', 'groups' => ['templates', 'list', 'indent', 'align']],
                    ['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
                    ['name' => 'links'],
                    ['name' => 'others'],
                    ['name' => 'insert', 'groups' => ['Table']],
                ]
            ]
        ]) 
    ?>

    <div class="form-group">
        <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
